﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Collections.Generic;
using 聚欣订单分析.PublicClass;

namespace 聚欣订单分析
{
    public partial class kptj : System.Web.UI.Page
    {
        PLSQLClass PL = new PLSQLClass();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnUpload_Click(object sender, EventArgs e)
        {
            List<object> keyValues = this.ASPxGridView1.GetSelectedFieldValues("ID");
            string strSQL1 = "update tbl_DDB set 开票='待审',开票日期='" + deHKRQ.Value.ToString() + "',开票金额='" + seHKJE.Value.ToString() + "',状态='开票待审' where ID=" + keyValues[0].ToString();
            string strSQL2 = "insert into tbl_KPSH VALUES('" + keyValues[0].ToString() + "','" + ASPxMemo1.Text.Trim() + "',0)";
            PL.ExecuteSqlWithGoUseTran(strSQL1 + "go" + strSQL2);
            JsHelper.AlertAndRedirect("提交成功", "kptj.aspx");
        }

        protected void btnExcel_Click(object sender, EventArgs e)
        {
            ASPxGridViewExporter1.WriteXlsxToResponse("待开票");
        }
    }
}
